unit sci.constants;

interface
uses
  Math, sci.types, sci.log;

type
  TConst = record
    name: string;
    v: TValue;
  end;

const
  MAX_CONSTS = 1000;

var
  constants: array [1..MAX_CONSTS] of TConst;
  constcnt: integer;

function LookUpConst(name: string): integer;
function GetConstAt(i: integer): TValue;

implementation

function LookUpConst(name: string): integer;
var
  i: integer;
begin
  for i := 1 to constcnt do
    if name = constants[i].name then exit(i);
  exit(-1);
end;

function GetConstAt(i: integer): TValue;
begin
  exit(constants[i].v);
end;

initialization
  constcnt := 1;            { XXX }
  constants[1].name := 'pi';
  constants[1].v := pi;


end.
